
<include file="Public:header" />
<hr />
<div class="span-3 prepend-1 colborder">
    <div class="member_menu">
        <include file="Member:menu" />
    </div>
</div>
<script src="__ROOT__/Public/Js/xheditor/xheditor-zh-cn.min.js"></script>
<script type="text/javascript" src="__ROOT__/Public/Js/dateinput/jquery.date_input.pack.js"></script>
<link rel="stylesheet" href="__ROOT__/Public/Js/dateinput/date_input.css" type="text/css">

<script>
    $(function() {
        //$( ".datepicker" ).datepicker({dateFormat: 'yy-m-d'});
        $(".datepicker").date_input();
    });

</script>

<script type="text/javascript">
    $(function(){
        $('#province').change(function(){
            $("#city").load("__URL__/getcity", {provinceid: this.value}, function(){
                $('#city').show();
            });
        })
        $('#city').change(function(){
            $("#region").load("__URL__/getregion", {cityid: this.value}, function(){
                $('#region').show();
            });
        })
    })
    
</script>
<script type="text/javascript">
$(pageInit);
var editor;
function pageInit()
{
	var plugins={
		Code:{c:'btnCode',t:'插入代码',h:1,e:function(){
			var _this=this;
			var htmlCode='<div><select id="xheCodeType"><option value="html">HTML/XML</option><option value="js">Javascript</option><option value="css">CSS</option><option value="php">PHP</option><option value="java">Java</option><option value="py">Python</option><option value="pl">Perl</option><option value="rb">Ruby</option><option value="cs">C#</option><option value="c">C++/C</option><option value="vb">VB/ASP</option><option value="">其它</option></select></div><div><textarea id="xheCodeValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="确定" /></div>';			var jCode=$(htmlCode),jType=$('#xheCodeType',jCode),jValue=$('#xheCodeValue',jCode),jSave=$('#xheSave',jCode);
			jSave.click(function(){
				_this.loadBookmark();
				_this.pasteHTML('<pre class="prettyprint lang-'+jType.val()+'">'+_this.domEncode(jValue.val())+'</pre>');
				_this.hidePanel();
				return false;	
			});
			_this.showDialog(jCode);
		}},
		map:{c:'btnMap',t:'插入Google地图',e:function(){
			var _this=this;
			_this.showIframeModal('Google 地图','__ROOT__/Public/Js/xheditor/demos/googlemap/googlemap.html',
                        function(v){_this.pasteHTML('<img src="'+v+'" />');},538,404);
		}}
	};
	editor=$('#content').xheditor({upLinkUrl:'__ROOT__/Public/Js/xheditor/demos/upload.php?immediate=1',
        upImgUrl:'__ROOT__/Public/Js/xheditor/demos/upload.php?immediate=1',
        upFlashUrl:'__ROOT__/Public/Js/xheditor/demos/upload.php?immediate=1',
        upMediaUrl:'__ROOT__/Public/Js/xheditor/demos/upload.php?immediate=1',emots:{
		msn:{name:'MSN',count:40,width:22,height:22,line:8},
		pidgin:{name:'Pidgin',width:22,height:25,line:8,list:{smile:'微笑',cute:'可爱',wink:'眨眼',laugh:'大笑',victory:'胜利',sad:'伤心',cry:'哭泣',angry:'生气',shout:'大骂',curse:'诅咒',devil:'魔鬼',blush:'害羞',tongue:'吐舌头',envy:'羡慕',cool:'耍酷',kiss:'吻',shocked:'惊讶',sweat:'汗',sick:'生病',bye:'再见',tired:'累',sleepy:'睡了',question:'疑问',rose:'玫瑰',gift:'礼物',coffee:'咖啡',music:'音乐',soccer:'足球',good:'赞同',bad:'反对',love:'心',brokenheart:'伤心'}},
		ipb:{name:'IPB',width:20,height:25,line:8,list:{smile:'微笑',joyful:'开心',laugh:'笑',biglaugh:'大笑',w00t:'欢呼',wub:'欢喜',depres:'沮丧',sad:'悲伤',cry:'哭泣',angry:'生气',devil:'魔鬼',blush:'脸红',kiss:'吻',surprised:'惊讶',wondering:'疑惑',unsure:'不确定',tongue:'吐舌头',cool:'耍酷',blink:'眨眼',whistling:'吹口哨',glare:'轻视',pinch:'捏',sideways:'侧身',sleep:'睡了',sick:'生病',ninja:'忍者',bandit:'强盗',police:'警察',angel:'天使',magician:'魔法师',alien:'外星人',heart:'心动'}}
	},plugins:plugins,loadCSS:'<style>pre{margin-left:2em;border-left:3px solid #CCC;padding:0 1em;}</style>',shortcuts:{'ctrl+enter':submitForm}});
}
function submitForm(){ $('#proform').submit(); }
</script>
<div class="span-18 prepend-1  last">
    <switch name="dsp">
        <case value="add">
            <h4>添加活动</h4>
            <form id="proform" name="proform" method="post" action="__URL__/doadd" enctype="multipart/form-data">
                <table border="0" cellspacing="1" class="tb-b">
                    <tr>
                        <th>活动名称</th>
                        <td><input type="text" name="title" value="" class="input-b" /><input type="hidden" name="memberId" value="{$memberId}"/></td>
                    </tr>
                    <tr>
                        <th>活动类别</th>
                        <td>
                            <select name="cateId" id="input-b">

                                <volist name="cats" id="data"  >
                                    <option value="{$key}">{$data}</option>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>开始时间</th>
                        <td><input type="text" name="starttime" value="" class="datepicker" /></td>
                    </tr>
                    <tr>
                        <th>结束时间</th>
                        <td><input type="text" name="endtime" value="" class="datepicker" /></td>
                    </tr>
                    <tr>
                        <th>活动图片</th>
                        <td><input type="file"  name="attachment" value="" ></td>
                    </tr>
                    <tr>
                        <th>活动地点</th>
                        <td>
                            <select  class="comboBox" id="province" name="province" width="100">
                                <option value="-1">请选择</option>
                                <volist name="provinces" id="province" >
                                    <option value="{$province.id}">{$province.name}</option>
                                </volist>
                            </select>
                            <select class="comboBox"  id="city" name="city" width="100" style="display:none" >

                            </select>
                            <select class="comboBox" id="region" name="region" width="100"  style="display:none">

                            </select>


                        </td>
                    </tr>
                    <tr>
                        <th>联系方式</th>
                        <td><input type="text" name="contact" value="" /></td>
                    </tr>
                    <tr>
                        <th>活动介绍</th>
                        <td><textarea id="content" name="content"  rows="10" cols="90" ></textarea>
                        </td>
                    </tr>

                </table>
                <div align="center"><input type="submit" value="提交" class="input-btn-b" /></div>
            </form>
        </case>
        <case value="edit">
            <h4>编辑活动</h4>
            <form name="proform" method="post" action="__URL__/doedit" enctype="multipart/form-data">
                <table border="0" cellspacing="1" class="tb-b">
                    <tr>
                        <th>ID</th>
                        <td>{$aid}<input type="hidden" name="aid" value="{$aid}"></td>
                    </tr>
                    <tr>
                        <th>活动名称</th>
                        <td><input type="text" name="title" value="{$title}" class="input-b" /></td>
                    </tr>
                    <tr>
                        <th>活动类别</th>
                        <td>
                            <select name="cid">
                                <volist name="cats" id="c">
                                    <if condition="$c.id eq $id">
                                        <option value="{$c.id}" selected="selected">{$c.name}</option>
                                        <else />
                                        <option value="{$c.id}">{$c.name}</option>
                                    </if>
                                </volist>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>活动图片</th>
                        <td><input type="file"  name="attachment" value="{$attachment}" /> 当前图片：<a href="#" onmouseover="tooltip.show('<img src={$attachment|getProImg = ###} height=160 />');" onmouseout=tooltip.hide(); >{$attachment}</a></td>
                    </tr>
                    <tr>
                        <th>活动介绍</th>
                        <td><html:editor id="editor" name="content" type="FCKeditor" content="{$content}" /></td>
                    </tr>
                    <tr>
                        <th>发布时间</th>
                        <td><input type="text" name="postdate" value="{$postdate|date='Y-n-j H:i:s',###}" /></td>
                    </tr>
                </table>
                <div align="center"><input type="submit" value="提交" /></div>
            </form>
        </case>
        <default />
    </switch>
</div>
<div class="clear"></div>
<include file="Public:footer" />